package org.example.work1022.w3;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class School implements Intro {
    @Autowired
    private Printers printers;
    @Resource(name ="school")
    private Intro intro;

    public void print(){
        String str = intro.detail();
        printers.print(str);
    }

    @Override
    public String detail() {
        return "我是学校";
    }

}
